package com.flong.selenium;


import java.io.IOException;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;


public class WeixinTest1 {

	public static ChromeDriver driver;
	public static String url="http://mp.weixin.qq.com/s?__biz=MzAxNzMwNjE4MQ==&mid=401784298&idx=2&sn=6ee8aefa55fa2047dd82b07a8105f8b8&scene=21#wechat_redirect";
	public static int count1 =0;
	
    static {
    	//设置浏览器启动环境变量
    	System.setProperty("webdriver.chrome.driver", "D:\\DevSoft\\chromedriver.exe");
    	driver = new ChromeDriver();
    	driver.manage().timeouts().implicitlyWait(1000, TimeUnit.SECONDS);//SECONDS是秒的意思
    	count1=0;
    }
    

    

    public static void main(String[] args) throws IOException, Exception {
    	driver.get(url);

    	WebElement sdayE = driver.findElementById("js_read_area3");//根据Id去获取Web的元素
    	boolean enabled = sdayE.findElement(By.cssSelector("media_tool_meta tips_global meta_primary")).isEnabled();
    	WebElement findElement = sdayE.findElement(By.id("readNum3"));
    	System.out.println(findElement.getText());
    	//String pageSource = driver.getPageSource();
    	//System.out.println(pageSource);
    	 
    	
    	
    }

}